import 'package:flutter/material.dart';
import 'package:haokezufang/pages/home/tab_search/data_list.dart';

import '../../../widgets/room_list_item_widget.dart';
import '../../../widgets/search/index.dart';
import 'filter_bar/filter_drawer.dart';
import 'filter_bar/index.dart';

class IndexSearch extends StatefulWidget {
  const IndexSearch({super.key});

  @override
  State<IndexSearch> createState() => _IndexSearchState();
}

class _IndexSearchState extends State<IndexSearch> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      endDrawer: const FilterDrawer(),
      appBar: AppBar(
          // 去除 endDrawer 的默认按钮
          actions: [Container()],
          elevation: 0,
          backgroundColor: Colors.white,
          title: const MySearchBar(
            showLocation: true,
            showMap: true,
            inputValue: '',
          )),
      body: Column(
        children: [
          const FilterBar(),
          Expanded(
              child: ListView(
            children: dataList
                .map((e) => RoomListItemWidget(
                      data: e,
                    ))
                .toList(),
          ))
        ],
      ),
    );
  }
}
